<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang='zh-CN' xml:lang='zh-CN' xmlns='http://www.w3.org/1999/xhtml'>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta http-equiv="Content-Language" content="zh-CN"/>
        <meta name="robots" content="index, follow" />
        <link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico" />
        <title>氿上网</title>
        {$system_css}
        {$system_js}

    </head>
    <body>
        <div id="OSC_Screen">
            {include file="header.html"}
            <div id="OSC_Content" class='CenterDiv'>
                {include file='user_nav.html'}
                {include file="message.html"}
                <div class="MainForm" id="reg_page">

                    <h1 style="font-size:22px;margin-bottom:20px;">订单详情</h1>
                    <div>订单号：{$data.order_sn}&nbsp;&nbsp;&nbsp;&nbsp;<font color="#FE4E02">订单状态：{$data.status|translate}</font>&nbsp;&nbsp;订单时间：{$data.add_time|date}&nbsp;&nbsp;&nbsp;&nbsp;{if !empty($data.pay_time)}支付时间：{$data.pay_time|date}{/if}</div>
                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">买家信息</h1>
                    <div>买家账号:{$data.buyer_name}&nbsp;&nbsp;&nbsp;&nbsp;买家邮件:{$data.buyer_email}</div>


                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">产品列表</h1>
                    <div>
                        {if count($data.goods_list)>0}
                        <table style="border: 1px solid #CCCCCC; width: 900px;">
                            <thead>
                                <tr style="border:1px solid #ccc;">
                                    <th style="text-align:center;border: 1px solid #ccc">产品名称</th>
                                    <th style="text-align:center;border: 1px solid #ccc">产品图片</th>
                                    <th style="text-align:center;border: 1px solid #ccc">产品价格</th>
                                    <th style="text-align:center;border: 1px solid #ccc">评价</th>
                                </tr>
                            </thead>
                            <tbody>
                                {foreach from=$data.goods_list item=list}
                                <tr style="border:1px solid #ccc;">
                                    <td style="text-align:center;width:40%;border-right: 1px solid #ccc">{$list.goods_name}</td>
                                    <td style="text-align:center;border-right: 1px solid #ccc"><img src="{$list.goods_image}" width="100" height="100"/></td>
                                    <td style="text-align:center;border-right: 1px solid #ccc">{$data.account_str}</td>
                                     <td style="text-align:center;border-right: 1px solid #ccc">
                                        
                                         {if $data.status == 'success' AND $data.user_type == 'buyer' AND  $list.is_comment == 'uncomment'}
                                         <a href="/shop/user/goods/comment/{$list.goods_id}"> 买家评论</a>
                                         {elseif $data.status == 'success' AND $data.user_type == 'seller' AND  $list.is_reply == 'unreply'}
                                         <a href="/shop/user/goods/reply/{$list.comment_id}">卖家回复</a>
                                         {elseif $list.is_comment == 'commented'}
                                         产品已评价
                                         {else}
                                         亲!订单成功后再评论..
                                         {/if}
                                         
                                         
                                     </td>
                                </tr>
                                {/foreach}
                            </tbody>

                        </table>
                        {/if}
                    </div>


                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">订单操作</h1>
                    <div>

                        {if count($data.order_logs)>0}
                        <table style="border: 1px solid #CCCCCC; width: 900px;">
                            <thead>
                                <tr style="border:1px solid #ccc;">
                                    <th style="text-align:center;border: 1px solid #ccc">操作人</th>
                                    <th style="text-align:center;border: 1px solid #ccc">操作状态</th>
                                    <th style="text-align:center;border: 1px solid #ccc">转为状态</th>
                                    <th style="text-align:center;border: 1px solid #ccc">操作时间</th>
                                </tr>
                            </thead>
                            <tbody>
                                {foreach from=$data.order_logs item=list}
                                <tr style="border:1px solid #ccc;">
                                    <td style="text-align:center;width:40%;border: 1px solid #ccc">{$list.operator}</td>
                                    <td style="text-align:center;border: 1px solid #ccc">{$list.order_status|translate}</td>
                                    <td style="text-align:center;border: 1px solid #ccc">{$list.changed_status|translate}</td>
                                    <td style="text-align:center;border: 1px solid #ccc">{$list.log_time|date}</td>
                                </tr>
                                {/foreach}
                            </tbody>

                        </table>
                        {/if}

                    </div>

                    <h1 style="font-size:22px;margin-bottom:20px;margin-top: 20px;">我要操作</h1>
                    <form action="/shop/{$data.user_type}/order/operate" method="post">
                        <input type="hidden" value="{$_token}" name="_token"/>
                        <input type="hidden" value="{$data.id}" name="order_id"/>

                        {if $data.user_type == 'seller'}
                        {if $data.status == 'payed'}
                        <input type="radio" value="shipped" name="pay_status" checked="true"/>发货&nbsp;&nbsp;&nbsp;
                        {/if}
                        {/if}

                        {if $data.user_type == 'buyer'}
                        {if $data.status == 'shipped'}
                        <input type="radio" value="success" name="pay_status" checked="true"/>收货&nbsp;&nbsp;&nbsp;
                        {/if}

                        {if $data.status == 'unpay'}
                        <input type="radio" value="payed" name="pay_status" checked="true"/>付款&nbsp;&nbsp;&nbsp;
                        {/if}
                        {/if}
                        {if $data.status == 'unpay'}
                        <input type="radio" value="canceled" name="pay_status" checked="true"/>取消&nbsp;&nbsp;&nbsp;
                        {/if}

                        <input type="submit" value="确认" />
                        

                    </form>
                    <div class='clear'></div>
                </div>

            </div>
            <div class='clear'></div></div>
        <div class='clear'></div>
        {include file="footer.html"}
        </div>


    </body>
</html>
